﻿
@{
    ViewBag.Title = "Form";
    Layout = "~/Views/Shared/_LayoutIndex.cshtml";
}
<script src="~/Content/scripts/utils/LeSoft.js"></script>
@using LeSoft.Application.Code;
<script>
    var _organizeid = "@LeSoft.Application.Code.OperatorProvider.Provider.Current().CompanyId"
    var keyValue = request('keyValue');
    var QCode = "";
    var MemberId;
    var State = 0;
    $(function () { 
        var w = window.screen.width;
        if (w < 1200) {
            $(".curved_box").css({ "width": "96%", "margin-left": "2%" })
        }
        InitialPage();
        InitControl();
        GetGrid1(); 
    })
    //初始化数据
    function InitControl() { 
        if (!!keyValue) {
            $.SetForm({
                url: "../../QualificationManage/RentContract/GetInfo",
                param: { keyValue: keyValue },
                success: function (data) {
                    QCode = data.Code; 
                    $("#Info").SetWebControls(data.PStructInfo);
                    $("#Info").SetWebControls(data.PStruct);
                    $("#Info").SetWebControls(data.ContractDWelling);
                    MemberId = data.ContractDWelling.LiveInUserId;
                    $("#CompanyInfo").SetWebControls(data.CompanyInfo);
                    $("#Code").text(data.ContractDWelling.Code); 
                    $("#EndDate").val(formatDate(data.ContractDWelling.EndDate, 'yyyy-MM-dd'))
                    $("#BeginDate").val(formatDate(data.ContractDWelling.BeginDate, 'yyyy-MM-dd')) 
                    State = data.ContractDWelling.State;
                    if (data.ContractDWelling.State == 1) {
                        $("#lr-enabled").attr("hidden", "hidden");
                        $("#lr-surrender").attr("hidden", "hidden");
                        $("#lr-keep").attr("hidden", "hidden");
                    }
                    if (data.ContractDWelling.State == 2) {
                        $(".BaseClass").attr("disabled", "disabled");
                        $("#btn_Save").attr("disabled", "disabled");
                        $("#lr-sign").attr("hidden", "hidden");
                        $("#lr-surrender").attr("hidden", "hidden");
                        $("#lr-keep").attr("hidden", "hidden");
                    }
                    if (data.ContractDWelling.State == 3) {
                        $("#btn_Save").attr("disabled", "disabled");
                        $("#lr-sign").attr("hidden", "hidden");
                        $("#lr-enabled").attr("hidden", "hidden");
                        $(".BaseClass").attr("disabled", "disabled");
                    }
                    if (data.ContractDWelling.State >= 4) {
                        $("#btn_Save").attr("disabled", "disabled");
                        $("#lr-business").attr("disabled", "disabled");
                        $(".BaseClass").attr("disabled", "disabled"); 
                    }
                    if (data.ContractDWelling.BeginDate != "" && data.ContractDWelling.EndDate != "") {
                        $("#RentYearDate").val(GetTimes(data.ContractDWelling.BeginDate, data.ContractDWelling.EndDate));
                    }
                    $("#MemberInfo").SetWebControls(JSON.parse(data.MemberInfo));
                    $("#Description").val(data.ContractDWelling.Description)
                    $("#RoomCode").val(data.PStruct.Code);
                    $("#Area").val(data.Room.Area);
                    $("#HouseType").val(data.Room.HouseType);
                    $("#HouseTypeName").val(data.Room.HouseTypeName);
                    $("#QCode").html(data.Code);
                    $("#IsDeposit").val(data.IsDeposit);  
                    GetGrid1(data.residentlist); 
                    if (data.ContractDWelling.CommitDate == undefined) {
                        $("#CommitDate").val(formatDate(data.Room.EMoveInDate, 'yyyy-MM-dd'))
                    } else {
                        $("#CommitDate").val(formatDate(data.PStructInfo.CommitDate, 'yyyy-MM-dd')) 
                    }
                    GetAccessory(data.filelist);
                    $("#SignType").ComboBoxSetValue(data.ContractDWelling.SignType);
                    $("#HouseTypeName").ComboBoxSetValue(data.Room.HouseTypeName);
                    if (data.ContractDWelling.SignDate == null) {
                        $("#SignDate").val("@LeSoft.Util.Time.GetToday("yyyy-MM-dd HH:mm:ss")");
                    } 
                }
            })
        }
    }
    //初始化页面
    function InitialPage() {
        //layout布局
        $('#layout').layout({
            applyDemoStyles: true,
            onresize: function () {
                $(window).resize()
            }
        });
        $('.profile-content').height($(window).height() - 20);
        $('.profile-nav').height($(window).height() - 20);
        //组织机构
        $("#OrganizeId").ComboBoxTree({
            url: "../../BaseManage/Organize/GetTreeJsonById",
            height: "250px",
            description: "===选择组织机构===",
            click: function (item) {
                _organizeid = item.id;
            }
        });
        $("#OrganizeId").ComboBoxSetValue(_organizeid);
        $("#SignType").ComboBox({
            data: [{ "key": "1", "value": "单位" }, { "key": "2", "value": "个人" }],
            id: "key",
            text: "value",
            description: "==签约主体==",
        }); 
        $("#Unit").ComboBox({
            data: [{ "key": "0", "value": "天" }, { "key": "1", "value": "周" }, { "key": "2", "value": "月" }, { "key": "3", "value": "季" }, { "key": "4", "value": "年" }],
            id: "key",
            text: "value",
            description: "==周期==",
        });
        $("#Unit").ComboBoxSetValue(2);
        //户型
        $("#HouseTypeName").ComboBox({
            url: "../../SystemManage/DataItemDetail/GetDataItemTreeJson",
            param: { EnCode: "HouseType" },
            id: "value",
            text: "text",
            description: "==请选择==",
        }); 
    };
    //侧面切换显示/隐藏
    function profileSwitch(id) {
        if (id == "BillContent") {
            $("#LogRecord").hide();
            $("#BillContent").show();
        }
        else {
            $("#BillContent").hide();
            $("#LogRecord").show();
            getOperateGrid();
        }
    };
    function GetGrid1(data) {
        $gridTable = $("#gridTable");
        $gridTable.jqGrid({
            datatype: "json",
            height: 100,
            autowidth: true,
            colModel: [
                { label: "主键", name: "Id", hidden: true },
                { label: "姓名", name: "Name", index: "Name", width: 200, align: "center", sortable: false },
                {
                    label: "性别", name: "Sex", index: "Sex", width: 200, align: "center", sortable: false,
                    formatter: function (cellvalue) {
                        switch (cellvalue) {
                            case 1:
                                return "男";
                            case 2:
                                return "女";
                            default: return cellvalue;
                        }
                    }
                },
                { label: "身份证号码", name: "IDCard", index: "IDCard", width: 300, align: "center", sortable: false },
                { label: "关系", name: "Relation", index: "Relation", width: 200, align: "center", sortable: false },
                {
                    label: "本市常住人口", name: "IsPermanent", index: "IsPermanent", width: 300, align: "center", sortable: false,
                    formatter: function (cellvalue) {
                        switch (cellvalue) {
                            case 0:
                                return "否";
                            case 1:
                                return "是";
                            default: return cellvalue;
                        }
                    }
                },
                { label: "婚姻状况", name: "MarryInfo", index: "MarryInfo", width: 300, align: "center", sortable: false },
                { label: "说明", name: "Description", index: "Description", width: 200, align: "center", sortable: false }, 
            ],
            viewrecords: true,
            rowNum: 30,
            rowList: [30, 50, 100],
            pager: "#gridPager",
            sortname: 'Date',
            sortorder: 'desc',
            rownumbers: true,
            gridview: true,
        })
        $gridTable[0].addJSONData(data);
    }; 
    //操作记录
    function getOperateGrid() {
        alert(keyValue)
        $gridTable = $("#gridTable1");
        $gridTable.jqGrid({
            url: "../../SystemManage/Setting/GetOperateRecordList",
            postData: { BillId: keyValue },
            datatype: "json",
            height: $(window).height() - 141,
            autowidth: true,
            colModel: [
               { label: '项目主键', name: 'Id', hidden: true },
                        { label: '业务类别', name: 'Type', width: 100, align: 'center', sortable: false },
                        { label: '操作人', name: 'FromOperateName', width: 100, align: 'center', sortable: false },
                        { label: '操作时间', name: 'Date', width: 170, align: 'center', sortable: false },
                        {
                            label: "操作内容", name: "Content", index: "Content", width: 590, align: "left", sortable: false,
                            formatter: function (cellvalue, options, rowObject) {
                                if (!!rowObject.ToOperateName)
                                    return "发起者：" + rowObject.FromOperateName + "，接受者：" + rowObject.ToOperateName + "<br/>" + cellvalue;
                                else
                                    return "发起者：" + rowObject.FromOperateName + "<br/>" + cellvalue;
                            }
                        },
            ],
            viewrecords: true,
            rowNum: 300,
            rownumbers: true,
            gridview: true,

        });
    }
    //获取附件信息
    function GetAccessory(data) {
        File = data;
        var html1 = "";
        var html2 = ""; 
        for (var i = 0; i < File.length; i++) {
            if (i <= 5) {
                switch (File[i].FileType) {
                    case 1: //图片
                        html1 += "<td><div class='CS_C'ondblclick='GetAccess(\"" + File[i].FileUrl + "\");'><div class=CS_T><img src='" + File[i].FileUrl + "'alt='加载失败' /></div><div class='CS_D'>" + File[i].FileName + "</div></div></td>"
                        break;
                    case 2: //语音
                        html1 += "<td><div class='CS_C' ondblclick='GetAccess(\"" + File[i].FileUrl + "\");'><div class=CS_T><i class='fa fa file-audio-o'></i></div><div class='CS_D'>" + File[i].FileName + "</div></div></td>"
                        break;
                    case 3: //视频
                        html1 += "<td><div class='CS_C' ondblclick='GetAccess(\"" + File[i].FileUrl + "\");'><div class=CS_T><i class='fa fa file-movie-o'></i></div><div class='CS_D'>" + File[i].FileName + "</div></div></td>"
                        break;
                    case 4: //zip压缩文件  fa fa-file-zip-o
                        html1 += "<td><div class='CS_C'ondblclick='GetAccess(\"" + File[i].FileUrl + "\");'><div class=CS_T><i  class='fa fa-file-zip-o'></i></div><div class='CS_D'>" + File[i].FileName + "</div></div></td>"
                        break;
                    case 5: //文档
                        html1 += "<td><div class='CS_C'ondblclick='GetAccess(\"" + File[i].FileUrl + "\");'><div class=CS_T><i class='fa fa file-word-o'></i></div><div class='CS_D'>" + File[i].FileName + "</div></div></td>"
                        break;
                    default: break;
                }
            } else {
                switch (File[i].FileType) {
                    case 1: //图片
                        html2 += "<td><div class='CS_C'ondblclick='GetAccess(\"" + File[i].FileUrl + "\");'><div class=CS_T><img src='" + File[i].FileUrl + "'alt='加载失败' /></div><div class='CS_D'>" + File[i].FileName + "</div></div></td>"
                        break;
                    case 2: //语音
                        html2 += "<td><div class='CS_C' ondblclick='GetAccess(\"" + File[i].FileUrl + "\");'><div class=CS_T><i class='fa fa file-audio-o'></i></div><div class='CS_D'>" + File[i].FileName + "</div></div></td>"
                        break;
                    case 3: //视频
                        html2 += "<td><div class='CS_C' ondblclick='GetAccess(\"" + File[i].FileUrl + "\");'><div class=CS_T><i class='fa fa file-movie-o'></i></div><div class='CS_D'>" + File[i].FileName + "</div></div></td>"
                        break;
                    case 4: //zip压缩文件  fa fa-file-zip-o
                        html2 += "<td><div class='CS_C'ondblclick='GetAccess(\"" + File[i].FileUrl + "\");'><div class=CS_T><i  class='fa fa-file-zip-o'></i></div><div class='CS_D'>" + File[i].FileName + "</div></div></td>"
                        break;
                    case 5: //文档
                        html2 += "<td><div class='CS_C'ondblclick='GetAccess(\"" + File[i].FileUrl + "\");'><div class=CS_T><i class='fa fa file-word-o'></i></div><div class='CS_D'>" + File[i].FileName + "</div></div></td>"
                        break;
                    default: break;
                }
            }
        }
        $("#CS_IO").html(html1);
        $("#CS_IO1").html(html2);
    };
    //查看及下载附件
    function GetAccess(Url) {
        a = window.open(Url, "_blank", "width=500, height=500,status=0");
    };
    //合同操作
    function btn_Save(s) {
        GetDateTimes();
        var postData = {
            ContractId: keyValue,
            BeginDate: $("#BeginDate").val(),
            EndDate: $("#EndDate").val(),
            CommitDate: $("#CommitDate").val(),
            MonthlyRent: $("#MonthlyRent").val(),
            Deposit: $("#Deposit").val(),
            UnitNum: $("#UnitNum").val(),
            Unit: $("#Unit").val(),
            RentYear: $("#RentYear").val(),
            SignDate: $("#SignDate").val()
        }
        switch (s) {


            case 1://签约
                if (!$('#Info').Validform()) {
                    return false;
                }
                if ($("#SignDate").val() === "") {
                    dialogMsg("请输入签约日期", 0);
                    return false;
                }
                if (!$('#Info').Validform()) {
                    return false;
                }
                GetDateTimes();
                dialogConfirm('该操作执行后将无法逆转,是否签约！', function (r) {
                    if (r) {
                        $.SaveForm({
                            url: "../../QualificationManage/RentContract/SaveForm",
                            param: { keyValue: keyValue, type: s, postData: JSON.stringify(postData) },
                            loading: "正在保存数据...",
                            success: function () {
                                location.reload();
                            }
                        })
                    }
                });
                break;
            case 2://启用
                if (!$('#Info').Validform()) {
                    return false;
                }
                GetDateTimes();
                dialogConfirm('该操作执行后将无法逆转,是否启用！', function (r) {
                    if (r) {
                        $.SaveForm({
                            url: "../../QualificationManage/RentContract/SaveForm",
                            param: { keyValue: keyValue, type: s, postData: JSON.stringify(postData) },
                            loading: "正在保存数据...",
                            success: function () {
                                location.reload();
                            }
                        })
                    }
                });
                break;
            case 4://退租
                var url = '/QualificationManage/Contract/Detail?ContractId=' + keyValue + "&Type=3&MemberId=" + MemberId + "&IsBack=IsBack";
                dialogOpen({
                    id: "Detail",
                    title: '退租申请 ',
                    url: url,
                    width: "1100px",
                    height: "750px",
                    btn: ["提交申请","取消"],
                    callBack: function (iframeId) {
                        top.frames[iframeId].AcceptClick();
                    }
                });
                break;

            case 5://续租
                var url = '/QualificationManage/Contract/Detail?ContractId=' + keyValue + "&Type=2&MemberId=" + MemberId + "&IsBack=IsBack";
                dialogOpen({
                    id: "Detail",
                    title: '续租申请',
                    url: url,
                    width: "1100px",
                    height: "750px",
                    btn: ["提交申请", "取消"],
                    callBack: function (iframeId) {
                        top.frames[iframeId].AcceptClick();
                    }
                });
                break;
            default: return false;
                break;
        }

    };
    //查看申请单
    function GetTrial() {
        if (QCode === "") {
            dialogMsg("该合同没有申请单！", 0);
            return false;
        }
        top.tablist.newTab({
            id: "TrialForm",
            title: '申请单详情【' + QCode + '】',
            closed: true,
            icon: "fa fa-eye",
            url: top.contentPath + '/QualificationManage/FirstTrial/Form?keyValue=' + QCode
        });
    };
    //获取数据
    function GetTimes(sdate, edate) {
        var Sdate = new Date(Date.parse(sdate.replace(/-/g, "/"))).getTime();
        var Edate = new Date(Date.parse(edate.replace(/-/g, "/"))).getTime();
        var a = Math.floor((Edate - Sdate) / 86400000);
        var y = Math.floor(a / 365);
        var m = Math.floor((a - y * 365) / 30);
        var d = (a - y * 365 - m * 30);
        if (a > 740) {
            dialogMsg("租赁时限不能大于两年。", 0);
            return false;
        }
        if (d > 20) {
            m++;
        }
        if (m >= 12) {
            y++;
            m = m - 12;
        }
        var RentYearDate = "";
        RentYearDate = y + "年" + m + "个月";
        if (m == 0) {
            RentYearDate = y + "年";
        }
        $("#RentYear").val(y);
        return RentYearDate;
    };
    //计算时间戳
    function GetDateTimes(t) {
        var BeginDate = $("#BeginDate").val();
        var EndDate = $("#EndDate").val();
        if (t == 1) {
            var d2 = new Date(BeginDate);
            d2.setFullYear(d2.getFullYear() + 2);
            d2.setDate(d2.getDate() -1);
            d2.setDate(d2.getDate());
            $("#EndDate").val(formatDate(d2, 'yyyy-MM-dd'))
        } 
        var EndDate = $("#EndDate").val();
        if (BeginDate != "" && EndDate != "") {
            $("#RentYearDate").val(GetTimes(BeginDate, EndDate) == false ? "" : GetTimes(BeginDate, EndDate));
        }
    };

    //下载并保存合同
    function Download() {
        if (!keyValue) {
            dialogMsg(data, 0);
            return false;
        }
        else {
            $.ajax({
                url: "/QualificationManage/Contract/SaveFile?ContractId=" + keyValue,
                type: "post",
                dataType: "text",
                success: function (data) { 
                    var obj = eval('(' + data + ')');
                    if (obj.type == 1) {
                        var fileinfo = eval('(' + obj.resultdata + ')');                                                           
                        pl.downFile({
                            url: "/QualificationManage/Contract/DownloadContract",
                            data: "FileName=" + fileinfo.FileName + "&FilePath=" + fileinfo.FilePath,
                            method: "post"
                        })
                    }
                    else {
                        dialogMsg("文件保存失败，稍后重试", 0);
                    }
                }
            })
        }
    } 
</script>
<style>
    .CS_C { margin: 10px; width: 148px; height: 110px; border: solid 1px #F0F0F0; margin-right: 10px; } 
    .CS_C:hover { border: solid 1px #AFD4FA; background-color: #F5FAFF; } 
    .CS_T { width: 148px; height: 70px;  line-height: 70px; text-align: center;   } 
    .CS_T img {  width: 50px; } 
    .CS_D {  width: 148px; height: 40px; text-align: center;  } 
    i { transform: scale(2.5); -webkit-transform: scale(2.5); -moz-transform: scale(2.5); -o-transform: scale(2.5);  -ms-transform: scale(2.5);} 
    .formTitle { text-align: right; }
</style>
<style>
    .curved_box {
        display: inline-block;
        *display: inline;
        width: 70%;
        height: 1800px;
        margin: 20px;
        margin-left: 15%;
        padding: 50px;
        padding-top: 20px;
        background-color: #fff;
        border: 1px solid #eee;
        -webkit-box-shadow: 0 1px 40px rgba(0, 0, 0, 0.27), 0 0 60px rgba(0, 0, 0, 0.06) inset;
        -moz-box-shadow: 0 1px 40px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
        box-shadow: 0 1px 40px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
        position: relative;
        *zoom: 1;
    }
</style>
<div style="position:absolute;top:0; right:80px;z-index:1000;background:rgba(0, 0, 0, 0.1);padding:10px;border-radius:0px 0px 5px 5px;">
    <div class="btn-group">
        <a class="btn btn-default" id="lr-business" data-toggle="dropdown">业务<span class="caret"></span></a>
        <ul class="dropdown-menu">
            <li id="lr-sign"><a onclick="btn_Save(1)">签约</a></li>
            <li id="lr-enabled"><a onclick="btn_Save(2)">启用</a></li>
            <li id="lr-surrender"><a onclick="btn_Save(4)">退租</a></li>
            <li id="lr-keep"><a onclick="btn_Save(5)">续租</a></li>
        </ul>
        @*<a id="lr_Download" onclick="Download()" class="btn btn-default"><span class="fa fa-download"></span> &nbsp;下载文件</a>*@

    </div>
</div>

<div class="ui-layout" id="layout" style="height: 100%;  width: 100%;">
    <div class="ui-layout-west">
        <div class="west-Panel">
            <div class="profile-nav">
                <ul style="padding-top: 20px;">
                    <li class="active" onclick="profileSwitch('BillContent')">基础信息</li>
                    @*<li onclick="profileSwitch('1')">应收明细</li>
                        <li onclick="profileSwitch('2')">应付明细</li>
                        <li onclick="profileSwitch('3')">更多信息</li>*@
                    <li onclick="profileSwitch('LogRecord')">业务日志</li>
                </ul>
            </div>
        </div>
    </div>
    <div class="ui-layout-center">
        <div class="center-Panel">

            <div class="profile-content" style="background: #fff; ">

                <div id="BillContent">
                    <div class="curved_box">
                        <table class="form">
                            <tr>
                                <td class="formValue" colspan="4"></td>

                                <td class="formValue" colspan="2"><a href="#" onclick="GetTrial();" style="text-decoration:underline; color:blue;">申请单编号:<span id="QCode"></span></a></td>
                            </tr>

                        </table>
                        <div class="title" style="font-size:18px; font-weight:normal;">
                            基本信息
                        </div>
                        <table class="form" id="Info" style="margin-top:20px;">
                            <tr>
                                <td class="formTitle cs-1" style="  text-align:right;">所属机构</td>
                                <td class="formValue"><div id="OrganizeId" type="selectTree" disabled readonly class="ui-select "></div></td>
                                <td class="formTitle" style="  text-align:right;">合同编号</td>
                                <td class="formValue "><input class="form-control" readonly disabled id="Code" type="text" /></td>
                                <td class="formTitle cs-1" style="  text-align:right;">签约时间</td>
                                <td class="formValue"><input id="SignDate" type="text" isvalid="yes" checkexpession="NotNull" class="form-control input-wdatepicker BaseClass " placeholder="请输入签约时间" value="@LeSoft.Util.Time.GetToday("yyyy-MM-dd HH-mm-ss ")" onfocus="WdatePicker({ dateFmt: 'yyyy-MM-dd  HH:mm:ss  ' })" /></td>
                            </tr>
                            <tr>
                                <td class="formTitle cs-1" style="  text-align:right;">租赁房屋</td>
                                <td class="formValue" colspan="3"><input class="form-control" disabled readonly id="AllName" type="text" /></td>
                                <td class="formTitle cs-1" style="  text-align:right;">房屋编号</td>
                                <td class="formValue"><input class="form-control" disabled readonly id="RoomCode" type="text" /></td>

                            </tr>
                            <tr>
                                <td class="formTitle cs-1" style="  text-align:right;">建筑面积</td>
                                <td class="formValue"><input class="form-control" disabled readonly id="Area" type="text" /></td>
                                <td class="formTitle" style="  text-align:right;">户型</td>
                                <td class="formValue"><div id="HouseTypeName" readonly type="selectTree" class="ui-select"></div></td>
                                <td class="formTitle" style="  text-align:right;">朝向</td>
                                <td class="formValue"><input class="form-control" disabled readonly id="HouseType" type="text" /></td>
                            </tr>
                            <tr style=" height: 20px; border-bottom: 1px dashed #cecece;"><td colspan="4"></td> </tr>
                            <tr>
                                <td colspan="6">
                                    <div class="title" style="font-size: 18px; font-weight: normal;">
                                        租赁信息
                                    </div>
                                </td>
                            </tr>
                            <tr style="height: 20px;"><td colspan="6"></td> </tr>
                            <tr style="margin-top:20px;">
                                <td class="formTitle" style="  text-align:right;">租赁开始日期<font face="宋体">*</font></td>
                                <td class="formValue"><input id="BeginDate" type="text" class="form-control input-wdatepicker BaseClass " isvalid="yes" checkexpession="NotNull" placeholder="请输入租赁开始日期" value="@LeSoft.Util.Time.GetToday("yyyy-MM-dd ")" onblur="GetDateTimes(1);" onfocus="WdatePicker({maxDate: '#F{$dp.$D(\'EndDate\')}'});" /></td>
                                <td class="formTitle" style="  text-align:right;">租赁结束日期<font face="宋体">*</font></td>
                                <td class="formValue"><input id="EndDate" type="text" class="form-control input-wdatepicker BaseClass" isvalid="yes" checkexpession="NotNull" placeholder="请输入租赁结束日期" value="@LeSoft.Util.Time.GetToday("yyyy-MM-dd ")" onblur="GetDateTimes(2);" onfocus="WdatePicker({minDate:'#F{$dp.$D(\'BeginDate\')}'});" /></td>
                                <td class="formTitle" style="  text-align:right;">租赁年限<font face="宋体">*</font></td>
                                <td class="formValue">
                                    <input id="RentYear" class="form-control" type="hidden" />
                                    <input id="RentYearDate" class="form-control BaseClass" disabled type="text" isvalid="yes" checkexpession="NotNull" />
                                </td>
                            </tr>
                            <tr>
                                <td class="formTitle" style="  text-align:right;">交房日期<font face="宋体">*</font></td>
                                <td class="formValue"><input id="CommitDate" type="text" class="form-control input-wdatepicker BaseClass " isvalid="yes" checkexpession="NotNull" placeholder="请输入交房日期" value="@LeSoft.Util.Time.GetToday("yyyy-MM-dd ")" onfocus="WdatePicker({ dateFmt: 'yyyy-MM-dd ' })" /></td>
                                <td class="formTitle" style="  text-align:right;">每月租金<font face="宋体">*</font></td>
                                <td class="formValue"><input class="form-control BaseClass" readonly id="MonthlyRent" isvalid="yes" checkexpession="NotNull" type="number" /></td>
                                <td class="formTitle" style="  text-align:right;">付费周期<font face="宋体">*</font></td>
                                <td class="formValue">
                                    <table class="form">
                                        <tr>
                                            <td class="formValue"><input id="UnitNum" isvalid="yes" disabled class="form-control BaseClass" checkexpession="NotNull" type="number" value="1" min="1" style="width:100px;" /></td>
                                            <td class="formValue"><div id="Unit" isvalid="yes" disabled checkexpession="NotNull" type="selectTree" class="ui-select BaseClass" style="width: 100px;   border:#ccc 1px solid;"></div></td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            <tr>
                                <td class="formTitle" style="  text-align:right;">应付押金<font face="宋体">*</font></td>
                                <td class="formValue"><input class="form-control BaseClass" readonly id="Deposit" isvalid="yes" checkexpession="NotNull" type="number" /></td>
                                <td class="formTitle" style="  text-align:right;">已收押金<font face="宋体">*</font></td>
                                <td class="formValue"><input class="form-control BaseClass" readonly id="IsDeposit" isvalid="yes" checkexpession="NotNull" type="number" /></td>
                            </tr>
                            <tr style=" height: 20px; border-bottom: 1px dashed #cecece;"><td colspan="6"></td> </tr>
                            <tr>
                                <td colspan="6">
                                    <div class="title" style="font-size: 18px; font-weight: normal;">
                                        承租人信息
                                    </div>
                                </td>
                            </tr>
                        </table>
                        <table class="form" id="MemberInfo" style="margin-top:20px;">
                            <tr>
                                <td class="formTitle" style="  text-align:right;">入住人姓名</td>
                                <td class="formValue"><input class="form-control" disabled readonly id="Name" type="text" /></td>
                                <td class="formTitle" style="  text-align:right;">入住人编号</td>
                                <td class="formValue"><input class="form-control" disabled readonly id="Code" type="text" /></td>
                                <td class="formTitle" style="  text-align:right;">联系电话</td>
                                <td class="formValue"><input class="form-control" disabled readonly id="PhoneNum" type="text" /></td>
                            </tr>
                            <tr>
                                <td class="formTitle" style="  text-align:right;">身份证号码</td>
                                <td class="formValue"><input class="form-control" disabled readonly id="CertificateNO" type="text" /></td>
                                <td class="formTitle" style="  text-align:right;">委托代理人</td>
                                <td class="formValue"><input class="form-control" disabled readonly id="LinkMan" type="text" /></td>
                                <td class="formTitle" style="  text-align:right;">代理人电话</td>
                                <td class="formValue"><input class="form-control" disabled readonly id="LinkPhoneNum" type="text" /></td>
                            </tr>
                        </table>
                        <table class="form" id="CompanyInfo">
                            <tr>
                                <td class="formTitle" style="  text-align:right;">单位编号</td>
                                <td class="formValue"><input class="form-control" disabled readonly id="Code" type="text" /></td>
                                <td class="formTitle" style="  text-align:right;">营业执照编号</td>
                                <td class="formValue"><input class="form-control" disabled readonly id="Licene" type="text" /></td>
                                <td class="formTitle" style="  text-align:right;">法人代表</td>
                                <td class="formValue"><input class="form-control" disabled readonly id="Legal" type="text" /></td>
                            </tr>
                            <tr>
                                <td class="formTitle" style="  text-align:right;">入住人单位</td>
                                <td class="formValue" colspan="5"><input class="form-control" disabled readonly id="Name" type="text" /></td>
                            </tr>

                            <tr>
                                <td class="formTitle" style="  text-align:right;">单位地址</td>
                                <td class="formValue" colspan="5"><input class="form-control" disabled readonly id="Address" type="text" /></td>
                            </tr>
                            <tr>
                                <td class="formTitle" style="  text-align:right;">联系电话</td>
                                <td class="formValue"><input class="form-control" disabled readonly id="TelPhoneNum" type="text" /></td>
                                <td class="formTitle" style="  text-align:right;">签约主体</td>
                                <td class="formValue"><div id="SignType" disabled readonly type="selectTree" class="ui-select"></div></td>

                            </tr>
                            <tr style=" height: 20px; border-bottom: 1px dashed #cecece;"><td colspan="6"></td> </tr>
                            <tr><td colspan="6"><div class="panel-Title" style="border: 0px; font-size: 18px; font-weight: normal;">同住人</div></td></tr>
                            <tr style=" height: 10px;"><td colspan="6"></td> </tr>
                            <tr>
                                <td colspan="6">
                                    <div class="center-Panel">
                                        <div class="gridPanel">
                                            <table id="gridTable"></table>
                                        </div>
                                    </div>
                                </td>
                            </tr>
                            <tr style=" height: 20px; border-bottom: 1px dashed #cecece;"><td colspan="6"></td> </tr>
                            <tr style=" height: 20px;"><td colspan="6"></td> </tr>
                            <tr><td colspan="6"><div class="panel-Title" style="border: 0px; font-size: 18px; font-weight: normal;">附加说明</div></td></tr>
                            <tr>
                                <td class="formValue" colspan="6"><textarea id="Description" class="form-control BaseClass" readonly style="height: 80px;"></textarea></td>
                            </tr>
                            <tr style=" height: 20px; border-bottom: 1px dashed #cecece;"><td colspan="6"></td> </tr>
                            <tr><td colspan="6"><div class="panel-Title" style="border: 0px; font-size: 18px; font-weight: normal;">附件</div></td></tr>

                        </table>
                        <table class="from">
                            <tr id="CS_IO"></tr>
                            <tr id="CS_IO1"></tr>
                            <tr style=" height: 20px;"><td colspan="4"></td> </tr>
                        </table>
                    </div>

                </div>
                <div id="LogRecord" style="display: none;">
                    <div class="title">
                        操作日志
                    </div>
                    <div class="gridPanel">
                        <table id="gridTable1"></table>
                    </div>

                </div>

            </div>
        </div>
    </div>
</div>